<%@page import="com.company.entity.Chanpinfuwu"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html;charset=UTF-8"%>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>页面管理</title>
	<link rel="stylesheet" type="text/css"
		href="/back/index_data/xiugai_data/css.css">
		<link rel="stylesheet" type="text/css"
			href="/back/index_data/xiugai_data/manhuaDate.css">
			<script type="text/javascript"
				src="/back/index_data/xiugai_data/jquery.js"></script>
			<script type="text/javascript"
				src="/back/index_data/xiugai_data/manhuaDate.js"></script>
			<script type="text/javascript"
				src="/back/index_data/xiugai_data/jquery-1.js"></script>
			<!-- <script type="text/javascript" src="js/page.js" ></script> -->
			<script type="text/javascript">
//下面用于图片上传预览功能
function setImagePreview(avalue) {
var docObj=document.getElementById("doc");
 
var imgObjPreview=document.getElementById("preview");
if(docObj.files &&docObj.files[0])
{
//火狐下，直接设img属性
imgObjPreview.style.display = 'block';
imgObjPreview.style.width = '300';
imgObjPreview.style.height = '130'; 
//imgObjPreview.src = docObj.files[0].getAsDataURL();
 
//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
}
else
{
//IE下，使用滤镜
docObj.select();
var imgSrc = document.selection.createRange().text;
var localImagId = document.getElementById("img");
//必须设置初始大小
localImagId.style.width = "300";
localImagId.style.height = "100";
//图片异常的捕捉，防止用户修改后缀来伪造图片
try{
localImagId.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
}
catch(e)
{
alert("您上传的图片格式不正确，请重新选择!");
return false;
}
imgObjPreview.style.display = 'none';
document.selection.empty();
}
return true;
}
</script>
</head>

<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="/back/index_data/xiugai_data/coin02.png"><span><a
						href="#">首页</a>&nbsp;-&nbsp;<a href="#">服务范围</a>&nbsp;-</span>&nbsp;产品服务



				
			</div>
		</div>

		<div class="page">
			<!-- vip页面样式 -->
			<div class="vip">
				<div class="xiu" style="display:inline;">
					<form action="/products_save.action" method="post"
						enctype="multipart/form-data">
						<input type="hidden" name="p_id"> 产品名称： <input type="text"
							name="chanpinfuwu.chanpinmingcheng" /> 产品介绍： <textarea type="text"
							name="chanpinfuwu.content" ></textarea>
							<input type="radio" name="chanpinfuwu.fenlei" value="1" checked>除垢系列
							<input type="radio" name="chanpinfuwu.fenlei" value="2" checked>净水系列
							<input type="radio" name="chanpinfuwu.fenlei" value="3" checked>污水系列
							<br>图片：<input type="file"
							name="upload1" value="上传图片1" /> <input type="file"
							name="upload2" value="上传图片2" /> <input type="file"
							name="upload3" value="上传图片3" /> <input type="file"
							name="upload4" value="上传图片4" />
							<button type="submit">添加数据</button>
					</form>
				</div>
				<!-- vip 表格 显示 -->
				<div class="conShow">
					<table border="1" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<td class="tdColor" width="250px">图片1</td>
								<td class="tdColor" width="250px">图片2</td>
								<td class="tdColor" width="250px">图片3</td>
								<td class="tdColor" width="250px">图片4</td>
								<td class="tdColor" width="66px">产品名称</td>
								<td class="tdColor" width="66px">产品介绍</td>
								<td class="tdColor" width="130px">操作</td>
							</tr>
							<%
                            	List<Chanpinfuwu> list=(List<Chanpinfuwu>)session.getAttribute("list");
                            	for(int i=0;i<list.size();++i)
                            	{
                            	Chanpinfuwu chanpinfuwu=list.get(i);
                            	out.println("  <form name='form"+chanpinfuwu.getId()+"' action='/products_update.action'  method='post'  enctype='multipart/form-data'>   <tr>   <input type='hidden' name='chanpinfuwu.id' value='"+chanpinfuwu.getId()+"' /> <td>   <div class='onsImg'>  <img src='/images/"+chanpinfuwu.getImages1()+"' id='preview'>    <input type='file' name='upload1' value='上传' id='doc' onchange='javascript:setImagePreview();' /></div>  </td>  <td>   <div class='onsImg'>  <img src='/images/"+chanpinfuwu.getImages2()+"' id='preview'>    <input type='file' name='upload2' value='上传' id='doc' onchange='javascript:setImagePreview();' /></div>  </td>  <td>   <div class='onsImg'>  <img src='/images/"+chanpinfuwu.getImages3()+"' id='preview'>    <input type='file' name='upload3' value='上传' id='doc' onchange='javascript:setImagePreview();' /></div>  </td>   <td>   <div class='onsImg'>  <img src='/images/"+chanpinfuwu.getImages4()+"' id='preview'>    <input type='file' name='upload4' value='上传' id='doc' onchange='javascript:setImagePreview();' /></div>  </td>      <td>    <input type='text' name='chanpinfuwu.chanpinmingcheng' value='"+chanpinfuwu.getChanpinmingcheng()+"' />       </td>    <td>    <input type='text' name='chanpinfuwu.content' value='"+chanpinfuwu.getContent()+"' />       </td>    </td>   <td><button class='btn' type='submit'  onclick='return confirm(\"确实要修改该条信息吗？\")'><img class='operation' src='/back/index_data/xiugai_data/update.png'></button>   <a onclick='return confirm(\"你确定要删除此条记录吗？\")' href='/products_delete.action?chanpinfuwu.id="+chanpinfuwu.getId()+"'>  <img class='operation delban' src='/back/index_data/xiugai_data/delete.png'></button>   </a> </td>  </tr></form>");
                            	}
                             %>
						</tbody>
					</table>

				</div>
				<!-- vip 表格 显示 end-->
			</div>
			<!-- vip页面样式end -->
		</div>
	</div>
	<script type="text/javascript">
// 广告弹出框
$(".delban").click(function(){
  $(".banDel").show();
});
$(".close").click(function(){
  $(".banDel").hide();
});
$(".no").click(function(){
  $(".banDel").hide();
});
// 广告弹出框 end
</script>
</body>
</html>